package com.ostrich.module_home.daily.adapter.provider

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ostrich.module_home.daily.entity.DailyEntity
import com.ostrich.module_home.databinding.HomeItemDailySingleTitleViewBinding

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/30 14:08
 * @Description : TextCardProvider
 */
class TextCardProvider(override val itemViewType: Int, override val layoutId: Int) :BaseItemProvider<DailyEntity>() {
    override fun onViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
       DataBindingUtil.bind<HomeItemDailySingleTitleViewBinding>(viewHolder.itemView)
    }
    override fun convert(helper: BaseViewHolder, item: DailyEntity) {
       helper.getBinding<HomeItemDailySingleTitleViewBinding>()?.viewModel = item
        helper.getBinding<HomeItemDailySingleTitleViewBinding>()?.executePendingBindings()
    }
}